
window.onload=window.onresize=function(){
	var oBox=document.getElementById("box-wrap");
	var menu=document.getElementById("menu");
	var turn=true;
	menu.addEventListener("click",come1);
	function come1(ev){
		var e=ev||evemt;
		e.stopPropagation();
		if(turn){
			oBox.style.marginLeft="0px";
		}else{
			oBox.style.marginLeft="-374px";
		}
		turn=!turn;
		box.addEventListener("click",come,false);
		function come(){
			oBox.style.marginLeft="-374px";
			turn=true;
			return false;
		}
	}
	document.addEventListener("touchstart",function(ev){
		var e=ev||event;
		e=e.touches[0];
		var disx1=e.clientX;
		document.addEventListener("touchmove",function(ev){
			var e=ev||event;
			e=e.touches[0];
			var disx2=e.clientX;
			if(Math.abs(disx2-disx1)>150){
				if(disx1>disx2){
					oBox.style.marginLeft="-374px";
					turn=true;
				}else{
					oBox.style.marginLeft="0px";
					turn=false;
				}
			}
		})
	});
	
	
}
